// Copyright (C) Kumo inc. and its affiliates.
// Author: Jeff.li lijippy@163.com
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//

#pragma once

#include <turbo/base/macros.h>
#include <turbo/utility/status.h>

namespace nebula::io {

    struct FileMode {
        enum type {
            READ, WRITE, READWRITE
        };
    };

    struct IOContext;
    struct CacheOptions;

    /// EXPERIMENTAL: convenience global singleton for default IOContext settings
    TURBO_EXPORT
    const IOContext &default_io_context();

    /// \brief Get the capacity of the global I/O thread pool
    ///
    /// Return the number of worker threads in the thread pool to which
    /// Nebula dispatches various I/O-bound tasks.  This is an ideal number,
    /// not necessarily the exact number of threads at a given point in time.
    ///
    /// You can change this number using SetIOThreadPoolCapacity().
    TURBO_EXPORT int GetIOThreadPoolCapacity();

    /// \brief Set the capacity of the global I/O thread pool
    ///
    /// Set the number of worker threads in the thread pool to which
    /// Nebula dispatches various I/O-bound tasks.
    ///
    /// The current number is returned by GetIOThreadPoolCapacity().
    TURBO_EXPORT turbo::Status SetIOThreadPoolCapacity(int threads);

    class FileInterface;

    class Seekable;

    class Writable;

    class Readable;

    class OutputStream;

    class FileOutputStream;

    class InputStream;

    class ReadableFile;

    class RandomAccessFile;

    class MemoryMappedFile;

    class WritableFile;

    class ReadWriteFileInterface;

    class LatencyGenerator;

    class BufferOutputStream;

    class BufferReader;

    class CompressedInputStream;

    class CompressedOutputStream;

    class BufferedInputStream;

    class BufferedOutputStream;

}  // namespace nebula::io

